package com.ruoyi.cngj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cngj.mapper.CngjInformationMapper;
import com.ruoyi.cngj.domain.CngjInformation;
import com.ruoyi.cngj.service.ICngjInformationService;
import com.ruoyi.common.core.text.Convert;

/**
 * 资料下载Service业务层处理
 * 
 * @author yuexl
 * @date 2024-06-27
 */
@Service
public class CngjInformationServiceImpl implements ICngjInformationService 
{
    @Autowired
    private CngjInformationMapper cngjInformationMapper;

    /**
     * 查询资料下载
     * 
     * @param id 资料下载ID
     * @return 资料下载
     */
    @Override
    public CngjInformation selectCngjInformationById(String id)
    {
        return cngjInformationMapper.selectCngjInformationById(id);
    }

    /**
     * 查询资料下载列表
     * 
     * @param cngjInformation 资料下载
     * @return 资料下载
     */
    @Override
    public List<CngjInformation> selectCngjInformationList(CngjInformation cngjInformation)
    {
        return cngjInformationMapper.selectCngjInformationList(cngjInformation);
    }

    /**
     * 新增资料下载
     * 
     * @param cngjInformation 资料下载
     * @return 结果
     */
    @Override
    public int insertCngjInformation(CngjInformation cngjInformation)
    {
        cngjInformation.setId(IdWorker.getId());
        cngjInformation.setCreateTime(DateUtils.getNowDate());
        return cngjInformationMapper.insertCngjInformation(cngjInformation);
    }

    /**
     * 修改资料下载
     * 
     * @param cngjInformation 资料下载
     * @return 结果
     */
    @Override
    public int updateCngjInformation(CngjInformation cngjInformation)
    {
        cngjInformation.setUpdateTime(DateUtils.getNowDate());
        return cngjInformationMapper.updateCngjInformation(cngjInformation);
    }

    /**
     * 删除资料下载对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCngjInformationByIds(String ids)
    {
        return cngjInformationMapper.deleteCngjInformationByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除资料下载信息
     * 
     * @param id 资料下载ID
     * @return 结果
     */
    @Override
    public int deleteCngjInformationById(String id)
    {
        return cngjInformationMapper.deleteCngjInformationById(id);
    }
}
